home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11897 < prev    next >
Encoding:
Text File  |  1996-08-05  |  997 b   |  33 lines

  1. Path: pacsibm.org!root
  2. From: rvaughn@pacsibm.org (RussellMania)
  3. Newsgroups: comp.lang.c++
  4. Subject: DOS Like Pipe Operator In C++??
  5. Date: 16 Mar 1996 22:32:03 GMT
  6. Organization: PACS IBM SIG BBS
  7. Message-ID: <4iffh3$p01@netaxs.com>
  8. NNTP-Posting-Host: pacsibm.org
  9. Originator: root@pacsibm.org
  10.  
  11. Thanks for all repiles. Assume iostream.h loaded for following:
  12. class world {
  13.       int x;
  14.     public:
  15.       world(int a)      { x = a; }
  16.       void set(int xx)  { x = xx; }
  17. };
  18. class hello {
  19.       int x;
  20.       world view;  // define an object as a private member 
  21.     public:
  22.       void set(int x)    { view.set(x); }    // set function
  23.       int y;                    // data member
  24.       hello(int z):view(z)  { x = 57; y = 66; }  // constructor??
  25.       void display()   {cout << x << " " << y << '\n'; view.display(;}
  26. };
  27. void main(void)
  28. { hello peace(55); peace.display(); }
  29. Outputs are 57 66
  30.         and 55
  31. Is the : character in the constructor of class hello acting as
  32. a pipe?  Thanks again for all replies...Russell
  33.